home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / ConditionalMacros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  42.2 KB  |  1,386 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.h
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.0.1
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CONDITIONALMACROS__
  19. #define __CONDITIONALMACROS__
  20.  
  21. /****************************************************************************************************
  22.     UNIVERSAL_INTERFACES_VERSION
  23.     
  24.         0x0302 => version 3.0.2 - ???? for QTML 3.0 ????
  25.         0x0301 => version 3.0.1
  26.         0x0300 => version 3.0
  27.         0x0210 => version 2.1
  28.         This conditional did not exist prior to version 2.1
  29. ****************************************************************************************************/
  30. #define UNIVERSAL_INTERFACES_VERSION 0x0302
  31.  
  32. /****************************************************************************************************
  33.  
  34.     TARGET_CPU_≈    
  35.     These conditionals specify which microprocessor instruction set is being
  36.     generated.  At most one of these is true, the rest are false.
  37.  
  38.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  39.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  40.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  41.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  42.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  43.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  44.  
  45.  
  46.     TARGET_OS_≈    
  47.     These conditionals specify in which Operating System the generated code will
  48.     run. At most one of the these is true, the rest are false.
  49.  
  50.         TARGET_OS_MAC            - Generate code will run under Mac OS
  51.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  52.         TARGET_OS_UNIX            - Generate code will run under some unix 
  53.  
  54.  
  55.     TARGET_RT_≈    
  56.     These conditionals specify in which runtime the generated code will
  57.     run. This is needed when the OS and CPU support more than one runtime
  58.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  59.  
  60.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  61.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  62.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  63.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  64.  
  65.  
  66.     PRAGMA_≈
  67.     These conditionals specify whether the compiler supports particular #pragma's
  68.     
  69.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  70.         PRAGMA_ONCE              - Compiler supports: #pragma once
  71.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  72.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  73.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  74.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  75.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  76.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  77.  
  78.     FOUR_CHAR_CODE
  79.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  80.     is compiled down to the correct value on all compilers.
  81.  
  82.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  83.  
  84.     TYPE_≈
  85.     These conditionals specify whether the compiler supports particular types.
  86.  
  87.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  88.         TYPE_BOOL                - Compiler supports "bool"
  89.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  90.  
  91. ****************************************************************************************************/
  92.  
  93. #if defined(__MRC__)
  94.     /*
  95.         MrC[pp] compiler from Apple Computer, Inc.
  96.     */
  97.     #define TARGET_CPU_PPC              1
  98.     #define TARGET_CPU_68K              0
  99.     #define TARGET_CPU_X86              0
  100.     #define TARGET_CPU_MIPS             0
  101.     #define TARGET_CPU_SPARC            0        
  102.     #define TARGET_CPU_ALPHA            0
  103.     #define TARGET_OS_MAC                1
  104.     #define TARGET_OS_WIN32                0
  105.     #define TARGET_OS_UNIX                0
  106.     #define TARGET_RT_LITTLE_ENDIAN        0
  107.     #define TARGET_RT_BIG_ENDIAN        1
  108.     #define TARGET_RT_MAC_CFM            1
  109.     #define TARGET_RT_MAC_68881            0
  110.     #if (__MRC__  > 0x0200) && (__MRC__ < 0x0700)
  111.         #define PRAGMA_IMPORT            1
  112.     #else
  113.         #define PRAGMA_IMPORT            0
  114.     #endif
  115.     #define PRAGMA_STRUCT_ALIGN            1
  116.     #define PRAGMA_ONCE                    1
  117.     #define PRAGMA_STRUCT_PACK            0
  118.     #define PRAGMA_STRUCT_PACKPUSH        0
  119.     #define PRAGMA_ENUM_PACK            1
  120.     #define PRAGMA_ENUM_ALWAYSINT        0
  121.     #define PRAGMA_ENUM_OPTIONS            0
  122.     #define FOUR_CHAR_CODE(x)            (x)
  123.         
  124.     #if (__MRC__  > 0x0300) && (__MRC__ < 0x0700)
  125.         #if __option(longlong)
  126.             #define TYPE_LONGLONG        1
  127.         #else
  128.             #define TYPE_LONGLONG        0
  129.         #endif
  130.         #if __option(bool)
  131.             #define TYPE_BOOL            1
  132.         #else
  133.             #define TYPE_BOOL            0
  134.         #endif
  135.     #else
  136.         #define TYPE_LONGLONG            0
  137.         #define TYPE_BOOL                0
  138.     #endif
  139.     #define TYPE_EXTENDED                0
  140.     
  141.  
  142.  
  143. #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
  144.     /*
  145.         SC[pp] compiler from Apple Computer, Inc.
  146.     */
  147.     #define TARGET_CPU_PPC              0
  148.     #define TARGET_CPU_68K              1
  149.     #define TARGET_CPU_X86              0
  150.     #define TARGET_CPU_MIPS             0
  151.     #define TARGET_CPU_SPARC            0        
  152.     #define TARGET_CPU_ALPHA            0
  153.     #define TARGET_OS_MAC                1
  154.     #define TARGET_OS_WIN32                0
  155.     #define TARGET_OS_UNIX                0
  156.     #define TARGET_RT_LITTLE_ENDIAN        0
  157.     #define TARGET_RT_BIG_ENDIAN        1
  158.     #if defined(__CFM68K__)
  159.         #define TARGET_RT_MAC_CFM        1
  160.     #else
  161.         #define TARGET_RT_MAC_CFM        0
  162.     #endif
  163.     #if defined(mc68881)
  164.         #define TARGET_RT_MAC_68881        1
  165.     #else
  166.         #define TARGET_RT_MAC_68881        0
  167.     #endif
  168.     #if TARGET_RT_MAC_CFM 
  169.         #define PRAGMA_IMPORT            1
  170.         #if (__SC__ <= 0x0810)
  171.             /* old versions of SC don't support “#pragma import reset” */
  172.             #define PRAGMA_IMPORT_OFF    1
  173.         #endif
  174.     #else
  175.         #define PRAGMA_IMPORT            0
  176.     #endif
  177.     #define PRAGMA_STRUCT_ALIGN            0
  178.     #define PRAGMA_ONCE                    0
  179.     #define PRAGMA_STRUCT_PACK            0
  180.     #define PRAGMA_STRUCT_PACKPUSH        0
  181.     #define PRAGMA_ENUM_PACK            1
  182.     #define PRAGMA_ENUM_ALWAYSINT        0
  183.     #define PRAGMA_ENUM_OPTIONS            0
  184.     #define FOUR_CHAR_CODE(x)            (x)
  185.     
  186.     #define TYPE_LONGLONG                0
  187.     #define TYPE_EXTENDED                1
  188.     #if (__SC__  > 0x0810)
  189.         #if __option(bool)
  190.             #define TYPE_BOOL            1
  191.         #else
  192.             #define TYPE_BOOL            0
  193.         #endif
  194.     #else
  195.         #define TYPE_BOOL                0
  196.     #endif
  197.         
  198.  
  199.  
  200. #elif defined(__MWERKS__)
  201.     /*
  202.         CodeWarrior compiler from Metrowerks, Inc.
  203.     */
  204.     #if (__MWERKS__ < 0x0900) || macintosh
  205.         #define TARGET_OS_MAC                1
  206.         #define TARGET_OS_WIN32                0
  207.         #define TARGET_OS_UNIX                0
  208.         #define TARGET_CPU_X86              0
  209.         #define TARGET_CPU_MIPS             0
  210.         #define TARGET_CPU_SPARC            0        
  211.         #define TARGET_CPU_ALPHA            0
  212.         #define TARGET_RT_LITTLE_ENDIAN        0
  213.         #define TARGET_RT_BIG_ENDIAN        1
  214.         #if powerc
  215.             #define TARGET_CPU_PPC          1
  216.             #define TARGET_CPU_68K          0
  217.             #define TARGET_RT_MAC_CFM        1
  218.             #define TARGET_RT_MAC_68881        0
  219.         #else
  220.             #define TARGET_CPU_PPC          0
  221.             #define TARGET_CPU_68K          1
  222.             #if defined(__CFM68K__)
  223.                 #define TARGET_RT_MAC_CFM    1
  224.             #else
  225.                 #define TARGET_RT_MAC_CFM    0
  226.             #endif
  227.             #if __MC68881__
  228.                 #define TARGET_RT_MAC_68881    1
  229.             #else
  230.                 #define TARGET_RT_MAC_68881    0
  231.             #endif
  232.         #endif
  233.     #elif (__MWERKS__ >= 0x0900) && __INTEL__
  234.         #define TARGET_CPU_PPC              0
  235.         #define TARGET_CPU_68K              0
  236.         #define TARGET_CPU_X86              1
  237.         #define TARGET_CPU_MIPS             0
  238.         #define TARGET_CPU_SPARC            0        
  239.         #define TARGET_CPU_ALPHA            0
  240.         #define TARGET_OS_MAC                0
  241.         #define TARGET_OS_WIN32                1
  242.         #define TARGET_OS_UNIX                0
  243.         #define TARGET_RT_LITTLE_ENDIAN        1
  244.         #define TARGET_RT_BIG_ENDIAN        0
  245.         #define TARGET_RT_MAC_CFM            0
  246.         #define TARGET_RT_MAC_68881            0
  247.     #else    
  248.         #error unknown Metrowerks compiler
  249.     #endif
  250.  
  251.  
  252.     #if (__MWERKS__ >= 0x0700)
  253.         #define PRAGMA_IMPORT                TARGET_RT_MAC_CFM
  254.     #else
  255.         #define PRAGMA_IMPORT                0
  256.     #endif
  257.     #define PRAGMA_STRUCT_ALIGN                1
  258.     #define PRAGMA_ONCE                        1
  259.     #define PRAGMA_STRUCT_PACK                1
  260.     #define PRAGMA_STRUCT_PACKPUSH            1
  261.     #define PRAGMA_ENUM_PACK                0
  262.     #define PRAGMA_ENUM_ALWAYSINT            1
  263.     #define PRAGMA_ENUM_OPTIONS                0
  264.     #define FOUR_CHAR_CODE(x)                (x)
  265.     
  266.     #if (__MWERKS__ >= 0x1100)
  267.         #if __option(longlong)
  268.             #define TYPE_LONGLONG        1
  269.             #define _LONG_LONG            1        /* temporary */
  270.         #else
  271.             #define TYPE_LONGLONG        0
  272.         #endif
  273.     #else
  274.         #define TYPE_LONGLONG            0
  275.     #endif
  276.     #if (__MWERKS__ >= 0x1000)
  277.         #if __option(bool)
  278.             #define TYPE_BOOL            1
  279.         #else
  280.             #define TYPE_BOOL            0
  281.         #endif
  282.     #else
  283.         #define TYPE_BOOL                0
  284.     #endif
  285.  
  286.     #if TARGET_OS_MAC && TARGET_CPU_68K
  287.         typedef long double extended;
  288.         #define TYPE_EXTENDED            1
  289.     #else
  290.         #define TYPE_EXTENDED            0
  291.     #endif
  292.  
  293.  
  294.  
  295. #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  296.     /*
  297.         C and C++ compiler from Symantec, Inc.
  298.     */
  299.     #define TARGET_OS_MAC                1
  300.     #define TARGET_OS_WIN32                0
  301.     #define TARGET_OS_UNIX                0
  302.     #define TARGET_CPU_X86              0
  303.     #define TARGET_CPU_MIPS             0
  304.     #define TARGET_CPU_SPARC            0        
  305.     #define TARGET_CPU_ALPHA            0
  306.     #define TARGET_RT_LITTLE_ENDIAN        0
  307.     #define TARGET_RT_BIG_ENDIAN        1
  308.     #if powerc
  309.         #define TARGET_CPU_PPC          1
  310.         #define TARGET_CPU_68K          0
  311.         #define TARGET_RT_MAC_CFM        1
  312.         #define TARGET_RT_MAC_68881        0
  313.     #else
  314.         #define TARGET_CPU_PPC          0
  315.         #define TARGET_CPU_68K          1
  316.         #if defined(__CFM68K)
  317.             #define TARGET_RT_MAC_CFM    1
  318.         #else
  319.             #define TARGET_RT_MAC_CFM    0
  320.         #endif
  321.         #if mc68881
  322.             #define TARGET_RT_MAC_68881    1
  323.         #else
  324.             #define TARGET_RT_MAC_68881    0
  325.         #endif
  326.     #endif
  327.     #define PRAGMA_IMPORT                0
  328.     #define PRAGMA_ONCE                    1
  329.     #define PRAGMA_STRUCT_ALIGN            1
  330.     #define PRAGMA_STRUCT_PACK            0
  331.     #define PRAGMA_STRUCT_PACKPUSH        0
  332.     #define PRAGMA_ENUM_PACK            1
  333.     #define PRAGMA_ENUM_ALWAYSINT        0
  334.     #define PRAGMA_ENUM_OPTIONS            0
  335.     #define FOUR_CHAR_CODE(x)            (x)
  336.     
  337.     #if __useAppleExts__
  338.         #define TYPE_EXTENDED            1
  339.     #else
  340.         #define TYPE_EXTENDED            0
  341.     #endif
  342.     #define TYPE_LONGLONG                0
  343.     #define TYPE_BOOL                    0
  344.     
  345.  
  346.  
  347. #elif defined(THINK_C)
  348.     /*
  349.         THINK C compiler from Symantec, Inc.        << WARNING: Unsupported Compiler >>
  350.     */
  351.     #define TARGET_CPU_PPC              0
  352.     #define TARGET_CPU_68K              1
  353.     #define TARGET_CPU_X86              0
  354.     #define TARGET_CPU_MIPS             0
  355.     #define TARGET_CPU_SPARC            0        
  356.     #define TARGET_CPU_ALPHA            0
  357.     #define TARGET_OS_MAC                1
  358.     #define TARGET_OS_WIN32                0
  359.     #define TARGET_OS_UNIX                0
  360.     #define TARGET_RT_LITTLE_ENDIAN        0
  361.     #define TARGET_RT_BIG_ENDIAN        1
  362.     #define TARGET_RT_MAC_CFM            0
  363.     #if defined(mc68881)
  364.         #define TARGET_RT_MAC_68881        1
  365.     #else
  366.         #define TARGET_RT_MAC_68881        0
  367.     #endif
  368.     #define PRAGMA_IMPORT                0
  369.     #define PRAGMA_STRUCT_ALIGN            0
  370.     #define PRAGMA_ONCE                    1
  371.     #define PRAGMA_STRUCT_PACK            0
  372.     #define PRAGMA_STRUCT_PACKPUSH        0
  373.     #define PRAGMA_ENUM_PACK            1
  374.     #define PRAGMA_ENUM_ALWAYSINT        0
  375.     #define PRAGMA_ENUM_OPTIONS            0
  376.     #define FOUR_CHAR_CODE(x)            (x)
  377.     
  378.     #define TYPE_EXTENDED                1
  379.     #define TYPE_LONGLONG                0
  380.     #define TYPE_BOOL                    0
  381.     
  382.  
  383.  
  384. #elif defined(__PPCC__)
  385.     /*
  386.         PPCC compiler from Apple Computer, Inc.        << WARNING: Unsupported Compiler >>
  387.     */
  388.     #define TARGET_CPU_PPC              1
  389.     #define TARGET_CPU_68K              0
  390.     #define TARGET_CPU_X86              0
  391.     #define TARGET_CPU_MIPS             0
  392.     #define TARGET_CPU_SPARC            0        
  393.     #define TARGET_CPU_ALPHA            0
  394.     #define TARGET_OS_MAC                1
  395.     #define TARGET_OS_WIN32                0
  396.     #define TARGET_OS_UNIX                0
  397.     #define TARGET_RT_LITTLE_ENDIAN        0
  398.     #define TARGET_RT_BIG_ENDIAN        1
  399.     #define TARGET_RT_MAC_CFM            1
  400.     #define TARGET_RT_MAC_68881            0
  401.     #define PRAGMA_IMPORT                0
  402.     #define PRAGMA_STRUCT_ALIGN            1
  403.     #define PRAGMA_ONCE                    0
  404.     #define PRAGMA_STRUCT_PACK            0
  405.     #define PRAGMA_STRUCT_PACKPUSH        0
  406.     #define PRAGMA_ENUM_PACK            0
  407.     #define PRAGMA_ENUM_ALWAYSINT        0
  408.     #define PRAGMA_ENUM_OPTIONS            0
  409.     #define FOUR_CHAR_CODE(x)            (x)
  410.     
  411.     #define TYPE_EXTENDED                0
  412.     #define TYPE_LONGLONG                0
  413.     #define TYPE_BOOL                    0
  414.  
  415.  
  416. #elif defined(applec) && !defined(__SC__)
  417.     /*
  418.         MPW C compiler from Apple Computer, Inc.    << WARNING: Unsupported Compiler >>
  419.     */
  420.     #define TARGET_CPU_PPC              0
  421.     #define TARGET_CPU_68K              1
  422.     #define TARGET_CPU_X86              0
  423.     #define TARGET_CPU_MIPS             0
  424.     #define TARGET_CPU_SPARC            0        
  425.     #define TARGET_CPU_ALPHA            0
  426.     #define TARGET_OS_MAC                1
  427.     #define TARGET_OS_WIN32                0
  428.     #define TARGET_OS_UNIX                0
  429.     #define TARGET_RT_LITTLE_ENDIAN        0
  430.     #define TARGET_RT_BIG_ENDIAN        1
  431.     #define TARGET_RT_MAC_CFM            0
  432.     #if defined(mc68881)
  433.         #define TARGET_RT_MAC_68881        1
  434.     #else
  435.         #define TARGET_RT_MAC_68881        0
  436.     #endif
  437.     #define PRAGMA_IMPORT                0
  438.     #define PRAGMA_STRUCT_ALIGN            0
  439.     #define PRAGMA_ONCE                    0
  440.     #define PRAGMA_STRUCT_PACK            0
  441.     #define PRAGMA_STRUCT_PACKPUSH        0
  442.     #define PRAGMA_ENUM_PACK            0
  443.     #define PRAGMA_ENUM_ALWAYSINT        0
  444.     #define PRAGMA_ENUM_OPTIONS            0
  445.     /* Note: MPW C 3.2 had a bug where MACRO('xx   ') would cause 'xx  ' to be misevaluated */
  446.     #define FOUR_CHAR_CODE                
  447.  
  448.     #define TYPE_EXTENDED                1
  449.     #define TYPE_LONGLONG                0
  450.     #define TYPE_BOOL                    0
  451.  
  452.  
  453.  
  454. #elif defined(__GNUC__) && defined(NeXT)
  455.     /*
  456.         gcc from Next, Inc., with cpp-precomp (header precompiler)
  457.     */
  458.     #if defined(powerpc) || defined(ppc)
  459.         #define TARGET_CPU_PPC            1
  460.         #define TARGET_CPU_68K            0
  461.         #define TARGET_CPU_X86            0
  462.         #define TARGET_CPU_MIPS            0
  463.         #define TARGET_CPU_SPARC        0   
  464.         #define TARGET_CPU_ALPHA        0
  465.         #define TARGET_RT_MAC_CFM        0
  466.         #define TARGET_RT_MAC_68881        0
  467.         #define TARGET_RT_LITTLE_ENDIAN    0
  468.         #define TARGET_RT_BIG_ENDIAN    1
  469.     #elif defined(m68k)
  470.         #define TARGET_CPU_PPC            0
  471.         #define TARGET_CPU_68K            1
  472.         #define TARGET_CPU_X86            0
  473.         #define TARGET_CPU_MIPS            0
  474.         #define TARGET_CPU_SPARC        0   
  475.         #define TARGET_CPU_ALPHA        0
  476.         #define TARGET_RT_MAC_CFM        0
  477.         #define TARGET_RT_MAC_68881        0
  478.         #define TARGET_RT_LITTLE_ENDIAN 0
  479.         #define TARGET_RT_BIG_ENDIAN    1
  480.     #elif defined(sparc)
  481.         #define TARGET_CPU_PPC            0
  482.         #define TARGET_CPU_68K            0
  483.         #define TARGET_CPU_X86            0
  484.         #define TARGET_CPU_MIPS            0
  485.         #define TARGET_CPU_SPARC        1
  486.         #define TARGET_CPU_ALPHA        0
  487.         #define TARGET_RT_MAC_CFM        0
  488.         #define TARGET_RT_MAC_68881        0
  489.         #define TARGET_RT_LITTLE_ENDIAN    0
  490.         #define TARGET_RT_BIG_ENDIAN    1
  491.     #elif defined(i386) || defined(intel)
  492.         #define TARGET_CPU_PPC            0
  493.         #define TARGET_CPU_68K            0
  494.         #define TARGET_CPU_X86            1
  495.         #define TARGET_CPU_MIPS            0
  496.         #define TARGET_CPU_SPARC        0
  497.         #define TARGET_CPU_ALPHA        0
  498.         #define TARGET_RT_MAC_CFM        0
  499.         #define TARGET_RT_MAC_68881        0
  500.         #define TARGET_RT_LITTLE_ENDIAN    1
  501.         #define TARGET_RT_BIG_ENDIAN    0
  502.     #else
  503.         #error unrecognized NeXT GNU C compiler
  504.     #endif
  505.  
  506.  
  507.     #define TARGET_OS_MAC                0
  508.     #define TARGET_OS_WIN32                0
  509.     #define TARGET_OS_UNIX                1
  510.     #define PRAGMA_IMPORT                0
  511.     #define PRAGMA_STRUCT_ALIGN            1
  512.     #define PRAGMA_ONCE                    0
  513.     #define PRAGMA_STRUCT_PACK            0
  514.     #define PRAGMA_STRUCT_PACKPUSH        0
  515.     #define PRAGMA_ENUM_PACK            0
  516.     #define PRAGMA_ENUM_ALWAYSINT        0
  517.     #define PRAGMA_ENUM_OPTIONS            0
  518.     #define FOUR_CHAR_CODE(x)            (x)
  519.  
  520.     #define TYPE_EXTENDED                0
  521.     #ifdef _LONG_LONG
  522.         #define TYPE_LONGLONG            1
  523.     #else
  524.         #define TYPE_LONGLONG            0
  525.     #endif
  526.     #define TYPE_BOOL                    0
  527.  
  528.  
  529. #elif defined(__GNUC__)
  530.     /*
  531.         gC for MPW from Free Software Foundation, Inc.
  532.     */
  533.     #if #cpu(powerpc)
  534.         #define TARGET_CPU_PPC          1
  535.         #define TARGET_CPU_68K          0
  536.         #define TARGET_CPU_X86          0
  537.         #define TARGET_CPU_MIPS         0
  538.         #define TARGET_CPU_SPARC        0    
  539.         #define TARGET_CPU_ALPHA        0
  540.         #define TARGET_RT_MAC_CFM        1
  541.         #define TARGET_RT_MAC_68881        0
  542.     #elif #cpu(m68k)
  543.         #define TARGET_CPU_PPC          0
  544.         #define TARGET_CPU_68K          1
  545.         #define TARGET_CPU_X86          0
  546.         #define TARGET_CPU_MIPS         0
  547.         #define TARGET_CPU_SPARC        0    
  548.         #define TARGET_CPU_ALPHA        0
  549.         #define TARGET_RT_MAC_CFM        0
  550.         #define TARGET_RT_MAC_68881        0
  551.     #else
  552.         #error unsupported GNU C compiler
  553.     #endif
  554.     
  555.     #if #system(macos)
  556.         #define TARGET_OS_MAC            1
  557.         #define TARGET_OS_WIN32            0
  558.         #define TARGET_OS_UNIX            0
  559.     #elif #system(unix)
  560.         #define TARGET_OS_MAC            0
  561.         #define TARGET_OS_WIN32            0
  562.         #define TARGET_OS_UNIX            1
  563.     #else
  564.         #error unsupported GNU C compiler
  565.     #endif
  566.     
  567.     #define TARGET_RT_LITTLE_ENDIAN        0
  568.     #define TARGET_RT_BIG_ENDIAN        1
  569.     #define PRAGMA_IMPORT                0
  570.     #define PRAGMA_STRUCT_ALIGN            1
  571.     #define PRAGMA_ONCE                    0
  572.     #define PRAGMA_STRUCT_PACK            0
  573.     #define PRAGMA_STRUCT_PACKPUSH        0
  574.     #define PRAGMA_ENUM_PACK            0
  575.     #define PRAGMA_ENUM_ALWAYSINT        0
  576.     #define PRAGMA_ENUM_OPTIONS            0
  577.     #define FOUR_CHAR_CODE(x)            (x)
  578.  
  579.     #define TYPE_EXTENDED                0
  580.     #ifdef _LONG_LONG
  581.         #define TYPE_LONGLONG            1
  582.     #else
  583.         #define TYPE_LONGLONG            0
  584.     #endif
  585.     #define TYPE_BOOL                    0
  586.  
  587.  
  588.  
  589. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  590.     /*
  591.         xlc and xlC on RS/6000 from IBM, Inc.
  592.     */
  593.     #define TARGET_CPU_PPC              1
  594.     #define TARGET_CPU_68K              0
  595.     #define TARGET_CPU_X86              0
  596.     #define TARGET_CPU_MIPS             0
  597.     #define TARGET_CPU_SPARC            0        
  598.     #define TARGET_CPU_ALPHA            0
  599.     #if defined(_AIX)
  600.         #define TARGET_OS_MAC            0
  601.         #define TARGET_OS_UNIX            1
  602.     #else
  603.         #define TARGET_OS_MAC            1
  604.         #define TARGET_OS_UNIX            0
  605.     #endif
  606.     #define TARGET_OS_WIN32                0
  607.     #define TARGET_RT_LITTLE_ENDIAN        0
  608.     #define TARGET_RT_BIG_ENDIAN        1
  609.     #define TARGET_RT_MAC_CFM            1
  610.     #define TARGET_RT_MAC_68881            0
  611.     #define PRAGMA_IMPORT                0
  612.     #define PRAGMA_STRUCT_ALIGN            1
  613.     #define PRAGMA_ONCE                    0
  614.     #define PRAGMA_STRUCT_PACK            0
  615.     #define PRAGMA_STRUCT_PACKPUSH        0
  616.     #define PRAGMA_ENUM_PACK            0
  617.     #define PRAGMA_ENUM_ALWAYSINT        0
  618.     #define PRAGMA_ENUM_OPTIONS            1
  619.     #define FOUR_CHAR_CODE(x)            (x)
  620.  
  621.     #define TYPE_EXTENDED                0
  622.     #ifdef _LONG_LONG
  623.         #define TYPE_LONGLONG            1
  624.     #else
  625.         #define TYPE_LONGLONG            0
  626.     #endif
  627.     #define TYPE_BOOL                    0
  628.  
  629.  
  630. #elif defined(_MSC_VER) && !defined(__MWERKS__) 
  631.     /*
  632.         Visual C++ from Microsoft, Inc.
  633.     */
  634.     #if defined(_M_M68K)    /* Visual C++ with Macintosh 68K target */
  635.         #define TARGET_CPU_PPC              0
  636.         #define TARGET_CPU_68K              1
  637.         #define TARGET_CPU_X86              0
  638.         #define TARGET_CPU_MIPS             0
  639.         #define TARGET_CPU_SPARC            0
  640.         #define TARGET_CPU_ALPHA            0
  641.         #define TARGET_OS_MAC                1
  642.         #define TARGET_OS_WIN32                0
  643.         #define TARGET_OS_UNIX                0
  644.         #define TARGET_RT_LITTLE_ENDIAN        0
  645.         #define TARGET_RT_BIG_ENDIAN        1
  646.         #define TARGET_RT_MAC_CFM            0
  647.         #define TARGET_RT_MAC_68881            0
  648.         #define PRAGMA_IMPORT                0
  649.         #define PRAGMA_STRUCT_ALIGN            1
  650.         #define PRAGMA_ONCE                     0
  651.         #define PRAGMA_STRUCT_PACK            1
  652.         #define PRAGMA_STRUCT_PACKPUSH        1
  653.         #define PRAGMA_ENUM_PACK            0
  654.         #define PRAGMA_ENUM_ALWAYSINT        0
  655.         #define PRAGMA_ENUM_OPTIONS            0
  656.         #define FOUR_CHAR_CODE(x)            (x)
  657.         #define TYPE_EXTENDED                0
  658.         #define TYPE_LONGLONG                0
  659.         #define TYPE_BOOL                    0
  660.     #elif defined(_M_MPPC)    /* Visual C++ with Macintosh PowerPC target */
  661.         #define TARGET_CPU_PPC              1
  662.         #define TARGET_CPU_68K              0
  663.         #define TARGET_CPU_X86              0
  664.         #define TARGET_CPU_MIPS             0
  665.         #define TARGET_CPU_SPARC            0
  666.         #define TARGET_CPU_ALPHA            0
  667.         #define TARGET_OS_MAC                1
  668.         #define TARGET_OS_WIN32                0
  669.         #define TARGET_OS_UNIX                0
  670.         #define TARGET_RT_LITTLE_ENDIAN        0
  671.         #define TARGET_RT_BIG_ENDIAN        1
  672.         #define TARGET_RT_MAC_CFM            1
  673.         #define TARGET_RT_MAC_68881            0
  674.         #define PRAGMA_IMPORT                0
  675.         #define PRAGMA_STRUCT_ALIGN            1
  676.         #define PRAGMA_ONCE                     0
  677.         #define PRAGMA_STRUCT_PACK            1
  678.         #define PRAGMA_STRUCT_PACKPUSH        1
  679.         #define PRAGMA_ENUM_PACK            0
  680.         #define PRAGMA_ENUM_ALWAYSINT        0
  681.         #define PRAGMA_ENUM_OPTIONS            0
  682.         #define FOUR_CHAR_CODE(x)            (x)
  683.         #define TYPE_EXTENDED                0
  684.         #define TYPE_LONGLONG                0
  685.         #define TYPE_BOOL                    0
  686.  
  687.     #elif defined(_M_IX86)    /* Visual C++ with Intel x86 target */
  688.         #define TARGET_CPU_PPC              0
  689.         #define TARGET_CPU_68K              0
  690.         #define TARGET_CPU_X86              1
  691.         #define TARGET_CPU_MIPS             0
  692.         #define TARGET_CPU_SPARC            0
  693.         #define TARGET_CPU_ALPHA            0
  694.         #define TARGET_OS_MAC                0
  695.         #define TARGET_OS_WIN32                1
  696.         #define TARGET_OS_UNIX                0
  697.         #define TARGET_RT_LITTLE_ENDIAN        1
  698.         #define TARGET_RT_BIG_ENDIAN        0
  699.         #define TARGET_RT_MAC_CFM            0
  700.         #define TARGET_RT_MAC_68881            0
  701.         #define PRAGMA_IMPORT                0
  702.         #define PRAGMA_STRUCT_ALIGN            0
  703.         #define PRAGMA_ONCE                     0
  704.         #define PRAGMA_STRUCT_PACK            1
  705.         #define PRAGMA_STRUCT_PACKPUSH        1
  706.         #define PRAGMA_ENUM_PACK            0
  707.         #define PRAGMA_ENUM_ALWAYSINT        0
  708.         #define PRAGMA_ENUM_OPTIONS            0
  709.         #define FOUR_CHAR_CODE(x)            (x) 
  710.         #define TYPE_EXTENDED                0
  711.         #define TYPE_LONGLONG                0
  712.         #if defined(__cplusplus) && (_MSC_VER >= 1100)
  713.             #define TYPE_BOOL                1
  714.         #else
  715.             #define TYPE_BOOL                0
  716.         #endif
  717.  
  718.         #elif defined(_M_ALPHA)        /* Visual C++ with Dec Alpha target */
  719.         #define TARGET_CPU_PPC              0
  720.         #define TARGET_CPU_68K              0
  721.         #define TARGET_CPU_X86              0
  722.         #define TARGET_CPU_MIPS             0
  723.         #define TARGET_CPU_SPARC            0
  724.         #define TARGET_CPU_ALPHA            1
  725.         #define TARGET_OS_MAC                0
  726.         #define TARGET_OS_WIN32                1
  727.         #define TARGET_OS_UNIX                0
  728.         #define TARGET_RT_LITTLE_ENDIAN        1
  729.         #define TARGET_RT_BIG_ENDIAN        0
  730.         #define TARGET_RT_MAC_CFM            0
  731.         #define TARGET_RT_MAC_68881            0
  732.         #define PRAGMA_IMPORT                0
  733.         #define PRAGMA_STRUCT_ALIGN            0
  734.         #define PRAGMA_ONCE                     0
  735.         #define PRAGMA_STRUCT_PACK            1
  736.         #define PRAGMA_STRUCT_PACKPUSH        1
  737.         #define PRAGMA_ENUM_PACK            0
  738.         #define PRAGMA_ENUM_ALWAYSINT        0
  739.         #define PRAGMA_ENUM_OPTIONS            0
  740.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  741.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  742.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  743.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  744.         #define TYPE_EXTENDED                0
  745.         #define TYPE_LONGLONG                0
  746.         #define TYPE_BOOL                    0
  747.  
  748.     #elif defined(_M_PPC)    /* Visual C++ for Windows NT on PowerPC target */
  749.         #define TARGET_CPU_PPC              1
  750.         #define TARGET_CPU_68K              0
  751.         #define TARGET_CPU_X86              0
  752.         #define TARGET_CPU_MIPS             0
  753.         #define TARGET_CPU_SPARC            0
  754.         #define TARGET_CPU_ALPHA            0
  755.         #define TARGET_OS_MAC                0
  756.         #define TARGET_OS_WIN32                1
  757.         #define TARGET_OS_UNIX                0
  758.         #define TARGET_RT_LITTLE_ENDIAN        1
  759.         #define TARGET_RT_BIG_ENDIAN        0
  760.         #define TARGET_RT_MAC_CFM            0
  761.         #define TARGET_RT_MAC_68881            0
  762.         #define PRAGMA_IMPORT                0
  763.         #define PRAGMA_STRUCT_ALIGN            0
  764.         #define PRAGMA_ONCE                     0
  765.         #define PRAGMA_STRUCT_PACK            1
  766.         #define PRAGMA_STRUCT_PACKPUSH        1
  767.         #define PRAGMA_ENUM_PACK            0
  768.         #define PRAGMA_ENUM_ALWAYSINT        0
  769.         #define PRAGMA_ENUM_OPTIONS            0
  770.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  771.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  772.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  773.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  774.         #define TYPE_EXTENDED                0
  775.         #define TYPE_LONGLONG                0
  776.         #define TYPE_BOOL                    0
  777.  
  778.         #elif defined(_M_MRX000)    /* Visual C++ for Windows NT on MIPS target */
  779.         #define TARGET_CPU_PPC              0
  780.         #define TARGET_CPU_68K              0
  781.         #define TARGET_CPU_X86              0
  782.         #define TARGET_CPU_MIPS             1
  783.         #define TARGET_CPU_SPARC            0
  784.         #define TARGET_CPU_ALPHA            0
  785.         #define TARGET_OS_MAC                0
  786.         #define TARGET_OS_WIN32                1
  787.         #define TARGET_OS_UNIX                0
  788.         #define TARGET_RT_LITTLE_ENDIAN        1
  789.         #define TARGET_RT_BIG_ENDIAN        0
  790.         #define TARGET_RT_MAC_CFM            0
  791.         #define TARGET_RT_MAC_68881            0
  792.         #define PRAGMA_IMPORT                0
  793.         #define PRAGMA_STRUCT_ALIGN            0
  794.         #define PRAGMA_ONCE                     0
  795.         #define PRAGMA_STRUCT_PACK            1
  796.         #define PRAGMA_STRUCT_PACKPUSH        1
  797.         #define PRAGMA_ENUM_PACK            0
  798.         #define PRAGMA_ENUM_ALWAYSINT        0
  799.         #define PRAGMA_ENUM_OPTIONS            0
  800.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  801.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  802.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  803.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  804.         #define TYPE_EXTENDED                0
  805.         #define TYPE_LONGLONG                0
  806.         #define TYPE_BOOL                    0
  807.     #endif
  808.  
  809.  
  810. #elif defined(__MOTO__)
  811.     /*
  812.         mcc from Motorola, Inc.  (( This is just a guess and may contain errors )) 
  813.     */
  814.     #define TARGET_CPU_PPC              1
  815.     #define TARGET_CPU_68K              0
  816.     #define TARGET_CPU_X86              0
  817.     #define TARGET_CPU_MIPS             0
  818.     #define TARGET_CPU_SPARC            0        
  819.     #define TARGET_CPU_ALPHA            0
  820.     #define TARGET_OS_MAC                1
  821.     #define TARGET_OS_WIN32                0
  822.     #define TARGET_OS_UNIX                0
  823.     #define TARGET_RT_LITTLE_ENDIAN        0
  824.     #define TARGET_RT_BIG_ENDIAN        1
  825.     #define TARGET_RT_MAC_CFM            1
  826.     #define TARGET_RT_MAC_68881            0
  827.     #define PRAGMA_IMPORT                0            /* how is this detected ?? */
  828.     #define PRAGMA_STRUCT_ALIGN            1
  829.     #define PRAGMA_ONCE                    1
  830.     #define PRAGMA_STRUCT_PACK            0
  831.     #define PRAGMA_STRUCT_PACKPUSH        0
  832.     #define PRAGMA_ENUM_PACK            0
  833.     #define PRAGMA_ENUM_ALWAYSINT        0
  834.     #define PRAGMA_ENUM_OPTIONS            0
  835.     #define FOUR_CHAR_CODE(x)            (x)
  836.     #define TYPE_LONGLONG                0            /* how is this detected ?? */
  837.     #ifdef _BOOL
  838.         #define TYPE_BOOL                1            
  839.     #else
  840.         #define TYPE_BOOL                0            
  841.     #endif
  842.     #define TYPE_EXTENDED                0
  843.  
  844.  
  845.  
  846. #elif defined(_MIPS_ISA)
  847.     /*
  848.         MIPSpro compiler from Silicon Graphics Inc.
  849.     */
  850.     #define TARGET_CPU_PPC              0
  851.     #define TARGET_CPU_68K              0
  852.     #define TARGET_CPU_X86              0
  853.     #define TARGET_CPU_MIPS             1
  854.     #define TARGET_CPU_SPARC            0        
  855.     #define TARGET_CPU_ALPHA            0
  856.     #define TARGET_OS_MAC                0
  857.     #define TARGET_OS_WIN32                0
  858.     #define TARGET_OS_UNIX                1
  859.     #define TARGET_RT_LITTLE_ENDIAN        0
  860.     #define TARGET_RT_BIG_ENDIAN        1
  861.     #define TARGET_RT_MAC_CFM            0
  862.     #define TARGET_RT_MAC_68881            0
  863.     #define PRAGMA_IMPORT                0
  864.     #define PRAGMA_STRUCT_ALIGN            0
  865.     #define PRAGMA_ONCE                    0
  866.     #define PRAGMA_STRUCT_PACK            1
  867.     #define PRAGMA_STRUCT_PACKPUSH        0
  868.     #define PRAGMA_ENUM_PACK            0
  869.     #define PRAGMA_ENUM_ALWAYSINT        0
  870.     #define PRAGMA_ENUM_OPTIONS            0
  871.     #define FOUR_CHAR_CODE(x)            (x)
  872.     #define TYPE_EXTENDED                0
  873.     #define TYPE_LONGLONG                0
  874.     #define TYPE_BOOL                    0
  875.  
  876.  
  877. #elif defined(__sparc)
  878.     /*
  879.         SPARCompiler compiler from Sun Microsystems Inc.
  880.     */
  881.     #define TARGET_CPU_PPC              0
  882.     #define TARGET_CPU_68K              0
  883.     #define TARGET_CPU_X86              0
  884.     #define TARGET_CPU_MIPS             0
  885.     #define TARGET_CPU_SPARC            1        
  886.     #define TARGET_CPU_ALPHA            0
  887.     #define TARGET_OS_MAC                0
  888.     #define TARGET_OS_WIN32                0
  889.     #define TARGET_OS_UNIX                1
  890.     #define TARGET_RT_LITTLE_ENDIAN        0
  891.     #define TARGET_RT_BIG_ENDIAN        1
  892.     #define TARGET_RT_MAC_CFM            0
  893.     #define TARGET_RT_MAC_68881            0
  894.     #define PRAGMA_IMPORT                0
  895.     #define PRAGMA_STRUCT_ALIGN            0
  896.     #define PRAGMA_ONCE                    0
  897.     #define PRAGMA_STRUCT_PACK            1
  898.     #define PRAGMA_STRUCT_PACKPUSH        0
  899.     #define PRAGMA_ENUM_PACK            0
  900.     #define PRAGMA_ENUM_ALWAYSINT        0
  901.     #define PRAGMA_ENUM_OPTIONS            0
  902.     #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  903.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  904.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  905.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  906.     #define TYPE_EXTENDED                0
  907.     #define TYPE_LONGLONG                0
  908.     #define TYPE_BOOL                    0
  909.  
  910.  
  911. #else
  912.     /*
  913.         Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
  914.     */
  915.     #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
  916.         #define TARGET_CPU_68K   0
  917.         #define TARGET_CPU_X86   0
  918.         #define TARGET_CPU_MIPS  0
  919.         #define TARGET_CPU_SPARC 0
  920.         #define TARGET_CPU_ALPHA 0
  921.     #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
  922.         #define TARGET_CPU_PPC   0
  923.         #define TARGET_CPU_X86   0
  924.         #define TARGET_CPU_MIPS  0
  925.         #define TARGET_CPU_SPARC 0
  926.         #define TARGET_CPU_ALPHA 0
  927.     #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
  928.         #define TARGET_CPU_PPC   0
  929.         #define TARGET_CPU_68K   0
  930.         #define TARGET_CPU_MIPS  0
  931.         #define TARGET_CPU_SPARC 0
  932.         #define TARGET_CPU_ALPHA 0
  933.     #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
  934.         #define TARGET_CPU_PPC   0
  935.         #define TARGET_CPU_68K   0
  936.         #define TARGET_CPU_X86   0
  937.         #define TARGET_CPU_SPARC 0
  938.         #define TARGET_CPU_ALPHA 0
  939.     #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
  940.         #define TARGET_CPU_PPC   0
  941.         #define TARGET_CPU_68K   0
  942.         #define TARGET_CPU_X86   0
  943.         #define TARGET_CPU_MIPS  0
  944.         #define TARGET_CPU_ALPHA 0
  945.     #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
  946.         #define TARGET_CPU_PPC   0
  947.         #define TARGET_CPU_68K   0
  948.         #define TARGET_CPU_X86   0
  949.         #define TARGET_CPU_MIPS  0
  950.         #define TARGET_CPU_SPARC 0
  951.  
  952.         
  953.     #else
  954.         /*
  955.             NOTE:    If your compiler errors out here then support for your compiler 
  956.                     has not yet been added to ConditionalMacros.h.  
  957.                     
  958.                     ConditionalMacros.h is designed to be plug-and-play.  It auto detects
  959.                     which compiler is being run and configures the TARGET_ conditionals
  960.                     appropriately.  
  961.                     
  962.                     The short term work around is to set the TARGET_CPU_ and TARGET_OS_
  963.                     on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
  964.                     
  965.                     The long term solution is to add a new case to this file which
  966.                     auto detects your compiler and sets up the TARGET_ conditionals.
  967.                     If you do this, send the changes you made to devsupport@apple.com
  968.                     to get it integrated into the next release of ConditionalMacros.h.
  969.         */
  970.         #error ConditionalMacros.h: unknown compiler (see comment above)
  971.         #define TARGET_CPU_PPC   0
  972.         #define TARGET_CPU_68K   0
  973.         #define TARGET_CPU_X86   0
  974.         #define TARGET_CPU_MIPS  0
  975.         #define TARGET_CPU_SPARC 0
  976.         #define TARGET_CPU_ALPHA 0
  977.     #endif
  978.     
  979.  
  980.  
  981.     #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  982.         #define TARGET_OS_WIN32  0
  983.         #define TARGET_OS_UNIX   0
  984.     #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
  985.         #define TARGET_OS_MAC    0
  986.         #define TARGET_OS_UNIX   0
  987.     #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
  988.         #define TARGET_OS_MAC    0
  989.         #define TARGET_OS_WIN32  0
  990.     #elif TARGET_CPU_PPC || TARGET_CPU_68K
  991.         #define TARGET_OS_MAC    1
  992.         #define TARGET_OS_WIN32  0
  993.         #define TARGET_OS_UNIX   0
  994.     #else
  995.         #error ConditionalMacros.h: unknown target OS (see comment above)
  996.     #endif
  997.  
  998.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  999.         #if TARGET_OS_MAC
  1000.             #define TARGET_RT_LITTLE_ENDIAN        0
  1001.             #define TARGET_RT_BIG_ENDIAN        1
  1002.         #elif TARGET_OS_WIN32
  1003.             #define TARGET_RT_LITTLE_ENDIAN        1
  1004.             #define TARGET_RT_BIG_ENDIAN        0
  1005.         #endif
  1006.     #endif
  1007.         
  1008.     #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1009.         #define TARGET_RT_LITTLE_ENDIAN        !TARGET_RT_BIG_ENDIAN
  1010.     #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
  1011.         #define TARGET_RT_BIG_ENDIAN        !TARGET_RT_LITTLE_ENDIAN
  1012.     #endif
  1013.     
  1014.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1015.         #error unknown endianess of target processor
  1016.     #endif
  1017.  
  1018.     #ifndef TARGET_RT_MAC_CFM
  1019.     #define TARGET_RT_MAC_CFM            TARGET_CPU_PPC
  1020.     #endif
  1021.     #ifndef TARGET_RT_MAC_68881
  1022.     #define TARGET_RT_MAC_68881            0
  1023.     #endif
  1024.  
  1025.         
  1026.     #ifndef PRAGMA_IMPORT
  1027.     #define PRAGMA_IMPORT                0
  1028.     #endif
  1029.     #ifndef PRAGMA_STRUCT_ALIGN
  1030.     #define PRAGMA_STRUCT_ALIGN            0
  1031.     #endif
  1032.     #ifndef PRAGMA_ONCE
  1033.     #define PRAGMA_ONCE                    0
  1034.     #endif
  1035.     #ifndef PRAGMA_STRUCT_PACK
  1036.     #define PRAGMA_STRUCT_PACK            0
  1037.     #endif
  1038.     #ifndef PRAGMA_STRUCT_PACKPUSH
  1039.     #define PRAGMA_STRUCT_PACKPUSH        0
  1040.     #endif
  1041.     #ifndef PRAGMA_ENUM_PACK
  1042.     #define PRAGMA_ENUM_PACK            0
  1043.     #endif
  1044.     #ifndef PRAGMA_ENUM_ALWAYSINT
  1045.     #define PRAGMA_ENUM_ALWAYSINT        0
  1046.     #endif
  1047.     #ifndef PRAGMA_ENUM_OPTIONS
  1048.     #define PRAGMA_ENUM_OPTIONS            0
  1049.     #endif
  1050.     #ifndef FOUR_CHAR_CODE
  1051.     #define FOUR_CHAR_CODE(x)            (x)
  1052.     #endif
  1053.  
  1054.     #ifndef TYPE_EXTENDED
  1055.     #define TYPE_EXTENDED                0
  1056.     #endif
  1057.     #ifndef TYPE_LONGLONG
  1058.     #define TYPE_LONGLONG                0
  1059.     #endif
  1060.     #ifndef TYPE_BOOL
  1061.     #define TYPE_BOOL                    0
  1062.     #endif
  1063. #endif
  1064.  
  1065.  
  1066.  
  1067.  
  1068. /****************************************************************************************************
  1069.  
  1070.     EXTERN_API≈    
  1071.     These conditionals are used to specify the calling convention of a function.
  1072.     Mac classic 68K and Win32 each have two possible calling conventions:
  1073.  
  1074.         EXTERN_API                - Classic 68K pascal, Win32 __cdecl
  1075.         EXTERN_API_C            - Classic 68K C,      Win32 __cdecl
  1076.         EXTERN_API_STDCALL        - Classic 68K pascal, Win32 __stdcall
  1077.         EXTERN_API_C_STDCALL    - Classic 68K C,      Win32 __stdcall
  1078.  
  1079.  
  1080.     CALLBACK_API≈    
  1081.     These conditionals are used to specify the calling convention of a function pointer.
  1082.     Mac classic 68K and Win32 each have two possible calling conventions:
  1083.  
  1084.         CALLBACK_API            - Classic 68K pascal, Win32 __stdcall
  1085.         CALLBACK_API_C            - Classic 68K C,      Win32 __stdcall
  1086.         CALLBACK_API_STDCALL    - Classic 68K pascal, Win32 __cdecl
  1087.         CALLBACK_API_C_STDCALL    - Classic 68K C,      Win32 __cdecl
  1088.  
  1089. ****************************************************************************************************/
  1090. #if TARGET_OS_MAC
  1091.     /*
  1092.         Mac OS
  1093.     */
  1094.     #define EXTERN_API(_type)                        extern pascal _type        /* Note: all Mac OS compilers must be able to handle the pascal keyword */
  1095.     #define EXTERN_API_C(_type)                        extern _type
  1096.     #define EXTERN_API_STDCALL(_type)                extern pascal _type
  1097.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1098.     #define CALLBACK_API(_type, _name)                pascal _type (*_name)
  1099.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1100.     #define CALLBACK_API_STDCALL(_type, _name)        pascal _type (*_name)
  1101.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)
  1102. #elif TARGET_OS_WIN32
  1103.     /*
  1104.         Win32 
  1105.     */
  1106.     #define EXTERN_API(_type)                        _type __cdecl
  1107.     #define EXTERN_API_C(_type)                        _type __cdecl
  1108.     #define EXTERN_API_STDCALL(_type)                _type __stdcall
  1109.     #define EXTERN_API_C_STDCALL(_type)                _type __stdcall
  1110.     #define CALLBACK_API(_type, _name)                _type (__cdecl * _name)
  1111.     #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
  1112.     #define CALLBACK_API_STDCALL(_type, _name)        _type (__stdcall * _name)
  1113.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall * _name)
  1114.  
  1115.     #undef pascal
  1116.     #define pascal
  1117. #else
  1118.     /*
  1119.         Unix or anything else
  1120.     */
  1121.     #define EXTERN_API(_type)                        extern _type
  1122.     #define EXTERN_API_C(_type)                        extern _type
  1123.     #define EXTERN_API_STDCALL(_type)                extern _type
  1124.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1125.     #define CALLBACK_API(_type, _name)                _type (*_name)
  1126.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1127.     #define CALLBACK_API_STDCALL(_type, _name)        _type (*_name)
  1128.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)    
  1129.  
  1130.     #undef pascal
  1131.     #define pascal    
  1132. #endif
  1133.  
  1134.  
  1135. /****************************************************************************************************
  1136.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  1137.  
  1138.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  1139.     GENERATING68K            - Compiler is generating 68k family instructions
  1140.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  1141.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  1142.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  1143.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  1144.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  1145.  
  1146. ****************************************************************************************************/
  1147.  
  1148. #if TARGET_OS_MAC
  1149. #define GENERATINGPOWERPC        TARGET_CPU_PPC
  1150. #else
  1151. #define GENERATINGPOWERPC        0
  1152. #endif
  1153. #define GENERATING68K            TARGET_CPU_68K
  1154. #define GENERATING68881            TARGET_RT_MAC_68881
  1155. #define GENERATINGCFM            TARGET_RT_MAC_CFM
  1156. #define CFMSYSTEMCALLS            TARGET_RT_MAC_CFM
  1157.  
  1158. #define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN
  1159. #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
  1160. /*
  1161.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  1162.           interface files for System 7 and Copland.  Now that Copland
  1163.           is canceled, all FOR_ conditionals have been removed from
  1164.           the interface files.  But, just in case you someone got an 
  1165.           interface file that uses them, the following sets the FOR_≈
  1166.           conditionals to a consistent, usable state.
  1167. */
  1168. #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES 0
  1169. #ifndef FOR_PTR_BASED_AE
  1170. #define FOR_PTR_BASED_AE 0
  1171. #endif  /*  ! defined(FOR_PTR_BASED_AE)  */
  1172.  
  1173. #define FOR_SYSTEM7_ONLY 1
  1174. #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED 1
  1175. #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE 1
  1176. #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE 1
  1177. #define FOR_SYSTEM8_COOPERATIVE 0
  1178. #define FOR_SYSTEM8_PREEMPTIVE 0
  1179.  
  1180.  
  1181.  
  1182. /****************************************************************************************************
  1183.  
  1184.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  1185.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  1186.                               are now more sensitive to change because CFM binds by name.  In the 
  1187.                               past, system routine names were compiled out to just an A-Trap.  
  1188.                               Macros have been added that each map an old name to its new name.  
  1189.                               This allows old routine names to be used in existing source files,
  1190.                               but the macros only work if OLDROUTINENAMES is true.  This support
  1191.                               will be removed in the near future.  Thus, all source code should 
  1192.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  1193.                               to see if your code has any old names left in it.
  1194.     
  1195.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  1196.                               has been moved from Strings to TextUtils.  It is conditionalized in
  1197.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  1198.                               This allows developers to upgrade to newer interface files without 
  1199.                               having to change the includes in their source code.  But, it allows
  1200.                               the slow migration of system calls to more understandable file locations.  
  1201.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  1202.                               default to false.
  1203.  
  1204. ****************************************************************************************************/
  1205. #ifndef OLDROUTINENAMES
  1206. #define OLDROUTINENAMES 0
  1207. #endif  /*  ! defined(OLDROUTINENAMES)  */
  1208.  
  1209. #ifndef OLDROUTINELOCATIONS
  1210. #define OLDROUTINELOCATIONS 0
  1211. #endif  /*  ! defined(OLDROUTINELOCATIONS)  */
  1212.  
  1213. /****************************************************************************************************
  1214.  
  1215.     OLDPIXMAPSTRUCT            - "Old" pixmap struct is used. Else use new cross-platform struct.
  1216.  
  1217. ****************************************************************************************************/
  1218. #ifndef OLDPIXMAPSTRUCT
  1219. #if TARGET_OS_MAC
  1220. #define OLDPIXMAPSTRUCT 1
  1221. #else
  1222. #define OLDPIXMAPSTRUCT 0
  1223. #endif  /* TARGET_OS_MAC */
  1224.  
  1225. #endif  /*  ! defined(OLDPIXMAPSTRUCT)  */
  1226.  
  1227.  
  1228.  
  1229.  
  1230. /****************************************************************************************************
  1231.     C specific conditionals
  1232.  
  1233.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  1234.                               are: all lowercase, use C strings instead of pascal strings, use 
  1235.                               Point* instead of Point).
  1236.  
  1237. ****************************************************************************************************/
  1238. #ifndef CGLUESUPPORTED
  1239. #ifdef THINK_C
  1240. #define CGLUESUPPORTED 0
  1241. #else
  1242. #define CGLUESUPPORTED 1
  1243. #endif  /*  defined(THINK_C)  */
  1244.  
  1245. #endif  /*  ! defined(CGLUESUPPORTED)  */
  1246.  
  1247.  
  1248.  
  1249. /****************************************************************************************************
  1250.     The following macros isolate the use of 68K inlines in function prototypes.
  1251.     On the Mac OS under the Classic 68K runtime, function prototypes were followed
  1252.     by a list of 68K opcodes which the compiler inserted in the generated code instead
  1253.     of a JSR.  Under Classic 68K on the Mac OS, this macro will put the opcodes
  1254.     in the right syntax.  For all other OS's and runtimes the macro suppress the opcodes.
  1255.     Example:
  1256.     
  1257.         EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
  1258.              ONEWORDINLINE(0xA8F6);
  1259.     
  1260. ****************************************************************************************************/
  1261.  
  1262. #if TARGET_OS_MAC && !TARGET_RT_MAC_CFM
  1263.     #define ONEWORDINLINE(w1) = w1
  1264.     #define TWOWORDINLINE(w1,w2) = {w1,w2}
  1265.     #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
  1266.     #define FOURWORDINLINE(w1,w2,w3,w4)  = {w1,w2,w3,w4}
  1267.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  1268.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)     = {w1,w2,w3,w4,w5,w6}
  1269.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)      = {w1,w2,w3,w4,w5,w6,w7}
  1270.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)      = {w1,w2,w3,w4,w5,w6,w7,w8}
  1271.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
  1272.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)  = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  1273.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
  1274.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12}
  1275. #else
  1276.     #define ONEWORDINLINE(w1)
  1277.     #define TWOWORDINLINE(w1,w2)
  1278.     #define THREEWORDINLINE(w1,w2,w3)
  1279.     #define FOURWORDINLINE(w1,w2,w3,w4)
  1280.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
  1281.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
  1282.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  1283.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
  1284.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
  1285.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  1286.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
  1287.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
  1288. #endif
  1289.  
  1290.  
  1291.  
  1292. /****************************************************************************************************
  1293.     The following macros fix weirdness with the way some compilers deal with the ## operator.
  1294.     As well, there are some warning macros to flush out the misuse of older macro names.
  1295.     
  1296. ****************************************************************************************************/
  1297.  
  1298. #define GLUE(a,b)   a##b
  1299. #define GLUE2(a,b)  GLUE(a,b)
  1300. #define GLUE3(a,b,c)    GLUE2(GLUE2(a,b),c)
  1301.  
  1302. #define OSTypeConst        FOUR_CHAR_CODE
  1303.  
  1304.  
  1305. // don't use these anymore as they cause problems for MrC and Symantec C
  1306. #if 0
  1307. #define TARGET_MAC        @#$% Use_TARGET_OS_MAC instead PLEASE!
  1308. #define TARGET_NON_MAC    @#$% Use_!TARGET_OS_MAC instead PLEASE!
  1309. #define TARGET_WIN32    @#$% Use_TARGET_OS_WIN32 instead PLEASE!
  1310. #define TARGET_UNIX        @#$% Use_TARGET_OS_UNIX instead PLEASE!
  1311. #define LITTLEENDIAN    @#$% Use_TARGET_RT_LITTLE_ENDIAN instead PLEASE!
  1312. #define BIGENDIAN        @#$% Use_TARGET_RT_BIG_ENDIAN instead PLEASE!
  1313.  
  1314. #define PRAGMA_PACK_SUPPORTED        @#$% Use_PRAGMA_STRUCT_PACK instead PLEASE!
  1315. #define PRAGMA_PACK_PUSH_SUPPORTED    @#$% Use_PRAGMA_STRUCT_PACKPUSH instead PLEASE!
  1316. #endif
  1317.  
  1318.  
  1319. /****************************************************************************************************
  1320.     The following macros resolve namespace conflicts with non-mac targets.
  1321.     
  1322. ****************************************************************************************************/
  1323.  
  1324. #if TARGET_OS_MAC
  1325. // Routines
  1326. #define MacOpenDriver    OpenDriver
  1327. #define MacCloseDriver    CloseDriver
  1328. #define MacDriverType    DriverType
  1329. #define MacSendMessage    SendMessage
  1330. #define MacCloseWindow    CloseWindow
  1331. #define MacShowWindow    ShowWindow
  1332. #define MacMoveWindow    MoveWindow
  1333. #define MacFindWindow    FindWindow
  1334. #define MacGetMenu GetMenu
  1335. #define MacAppendMenu AppendMenu
  1336. #define MacInsertMenu InsertMenu
  1337. #define MacDeleteMenu DeleteMenu
  1338. #define MacInsertMenuItem InsertMenuItem
  1339. #define MacDrawMenuBar DrawMenuBar
  1340. #define MacAnimatePalette AnimatePalette
  1341. #define MacResizePalette ResizePalette
  1342. #define MacGetCurrentProcess GetCurrentProcess
  1343. #define MacSetPort SetPort
  1344. #define MacSetCursor SetCursor
  1345. #define MacShowCursor ShowCursor
  1346. #define MacLineTo LineTo
  1347. #define MacSetRect SetRect
  1348. #define MacOffsetRect OffsetRect
  1349. #define MacInsetRect InsetRect
  1350. #define MacUnionRect UnionRect
  1351. #define MacEqualRect EqualRect
  1352. #define MacFrameRect FrameRect
  1353. #define MacInvertRect InvertRect
  1354. #define MacFillRect FillRect
  1355. #define MacCopyRgn CopyRgn
  1356. #define MacSetRectRgn SetRectRgn
  1357. #define MacOffsetRgn OffsetRgn
  1358. #define MacUnionRgn UnionRgn
  1359. #define MacXorRgn XorRgn
  1360. #define MacEqualRgn EqualRgn
  1361. #define MacFrameRgn FrameRgn
  1362. #define MacPaintRgn PaintRgn
  1363. #define MacInvertRgn InvertRgn
  1364. #define MacFillRgn FillRgn
  1365. #define MacGetPixel GetPixel
  1366. #define MacPtInRect PtInRect
  1367. #define MacGetCursor GetCursor
  1368. #define MacDrawText DrawText
  1369. #define MacLoadResource LoadResource
  1370. #define MacReplaceText ReplaceText
  1371. #define MacGetCurrentThread GetCurrentThread
  1372.  
  1373. // Structures
  1374. #define MacPolygon Polygon
  1375. #define MacRegion Region
  1376. #endif /* TARGET_OS_MAC */
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384. #endif /* __CONDITIONALMACROS__ */
  1385.  
  1386.